package com.autumn.zero.authorization.entitys.roles.querys;

import javax.persistence.Table;

import com.autumn.mybatis.mapper.annotation.ViewTable;
import com.autumn.zero.authorization.entitys.roles.Role;

/**
 * 角色用户查询
 * 
 * @author 杨昌国 2018-12-07 14:51:34
 */
@Table
@ViewTable(RoleByUserQuery.QUERY_COMMAND_TEXT)
public class RoleByUserQuery extends Role {

	/**
	 * 
	 */
	static final String QUERY_COMMAND_TEXT = "SELECT a.id,a.sort_id,a.is_sys_role,b.user_id,a.name,a.is_default,a.summary,a.gmt_create,a.gmt_modified"
			+ " FROM sys_role AS a INNER JOIN sys_user_role AS b on a.id = b.role_id";

	/**
	 * 
	 */
	private static final long serialVersionUID = 7645861615713164082L;

	/**
	 * 字段 userId
	 */
	public static final String FILED_USER_ID = "userId";
	
	/**
	 * 用户id
	 */
	private Long userId;

	/**
	 * 获取用户id
	 * 
	 * @return
	 */
	public Long getUserId() {
		return userId;
	}

	/**
	 * 设置用户id
	 * 
	 * @param userId 用户id
	 */
	public void setUserId(Long userId) {
		this.userId = userId;
	}
}
